<div id="content">
                    	<h3>Danh sách danh mục sản phẩm</h3>
                        
                        <div id="contentFunc">                        
                            <div class="create">
                                <a href="<?php echo base_url() ?>index.php/Quanlydanhmuc/them">Thêm danh mục</a>
                            </div>
                              
                            <div class="search">
                            	<?php 
                                    $attributes = array('id' => 'frmDM', 'name'=>'frmDM', 'method' => 'get');
                                    echo form_open_multipart('Quanlydanhmuc/index',$attributes);	         
							    ?>
                                
                            	<label>Từ khóa:</label>                          
                                <input type="search" id="txtSearch" name="key"/>
                                
                                <?php 
									if(isset($danhmucsdrop))
									{
										if(is_array($danhmucsdrop))
										{
											$options = array();
											foreach ($danhmucsdrop as $item)
											{
												$options[$item['madm']] = $item['tendanhmuc'];
											}
											if(isset($danhmuc))
											{
												echo form_dropdown('dm', $options, $danhmuc); 
											}
											else
											{
												echo form_dropdown('dm', $options,null);
											}
										}
									}		 
								?>
                                
                                <input type="submit" id="btnSearch" value="Tìm"/>
                            </div>
                            
                            <div class="dataTableDM">
                                <table class="tableDanhMuc">
                                    <tr class="colName">
                                        <th class="colValue">STT</th>
                                        <th class="colValue">Tên danh mục</th>
                                        <th class="colValue">Danh mục cha</th>
                                        <th class="colValue">Tên danh mục tiếng anh</th>
                                        <!--<th class="colValue">Xem</th>-->
                                        <th class="colValue">Sửa</th>
                                        <th class="colValue">Xóa</th>
                                    </tr>
                                    
                                    <?php 
										if(!empty($danhmucs))
										{
											for($stt = 0; $stt < count($danhmucs); $stt++)
											{	
												$dm = $danhmucs[$stt];
												echo "<tr class='rowValue'>";
													echo "<td class='rowId'>".($stt + 1)."</td>";
													echo "<td>{$dm['tendanhmuc']}</td>";
													//echo "<td>{$dm['hinh']}</td>";
													echo "<td >{$dm['tendanhmuc_cha']}</td>";
													echo "<td>{$dm['tendanhmuc_en']}</td>";
													
                                                	echo "<td>";
                                                		echo "<a href = '".base_url()."index.php/Quanlydanhmuc/sua/{$dm['madm']}'>";
                                               				echo "<img src = '".base_url()."images/sedit.png' alt='Sửa'/>";
                                                		echo "</a>";
                                                	echo "</td>";
                                                	echo "<td>";
                                                		echo "<a href = '".base_url()."index.php/Quanlydanhmuc/xoa/{$dm['madm']}'>";
                                               				echo "<img src = '".base_url()."images/sdelete.png' alt='Xóa'/>";
                                                		echo "</a>";
                                                	echo "</td>";										
                                                echo "</tr>";
											}	
										}
									?>
                                </table>
                            </div>
                         </div>
                    </div>
            </div>